package it.agm.fanta.fragment;

import it.agm.fanta.FantaserviceApp;
import it.agm.fanta.R;
import it.agm.fanta.adapter.RosaAdapter;
import it.agm.fanta.model.Giocatore;

import java.util.ArrayList;

import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
//import it.unisalento.appsalento.adapter.AppelliDettaglioEsameAdapter;

//import android.content.Intent;

public class RosaFragment extends Fragment {
	public static final String ARG_PLANET_NUMBER = "planet_number";
	
	public RosaFragment() {

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_rosa, container,false);
		if(FantaserviceApp.rosa != null && FantaserviceApp.lega != null && !FantaserviceApp.rosa.isEmpty()){
	        ListView listView = (ListView) rootView.findViewById(R.id.listViewGiocatoriRosa);
			ArrayList<Giocatore> list = FantaserviceApp.rosa;
			RosaAdapter adapter = new RosaAdapter(getActivity(), R.layout.row_calciatore_rosa,list);

			listView.setAdapter(adapter);
		}
		return rootView;
	}
}
